export function Passwordfuc(pwd: any, formRef: any) {
  return function Password(rule: any, value: any, callback:any) {
    if (value === '') {
      callback(new Error('Please input the password'));
    } else {
      if (pwd !== '') {
        if (!formRef.value) return;
        formRef.value.validateField('Password', () => null);
      }
      // callback();
    }
  };
}

export function confirmPwdfuc(pwd: any) {
  return function confirmPwd(rule: any, value: any, callback: any) {
    if (value === '') {
      callback(new Error('Please input the password again'));
    } else if (value !== pwd) {
      callback(new Error("Two inputs don't match!"));
    } else {
      callback();
    }
  };
}
